package com.scalar.chiptrack.sales.actions.quote;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;

/**
 * User: ganesh
 * Date: May 14, 2008
 * Time: 7:58:38 PM
 */
public class PreviousCommitmentsDetailsSearchScrollCommand extends PreviousQuotationLatestPriceBaseSearchAction
{
    public ActionForward executeCommand( ActionMapping mapping,
                                         ActionForm form,
                                         HttpServletRequest request,
                                         HttpServletResponse response ) throws IOException, ServletException {
        ActionForward actionForward = null;
        try
        {
            actionForward = scroll( mapping, form, request, response );
        }
        catch( Exception e )
        {
            e.printStackTrace();
            //actionForward = mapping.findForward( IActionForward.PCN_ERROR_PAGE );
        }
        return actionForward;
    }

    /**
     * filters here have some lists
     * tries to retrieve them either from request if present or queries
     * it from the db
     *
     * @param mapping ActionMapping
     * @param form    ActionForm
     * @param request HttpServletRequest
     * @return ActionForward
     */
    public ActionForward initFilters( ActionMapping mapping, ActionForm form,
                                      HttpServletRequest request )
    {
        return new ActionForward( mapping.getInput() );
    }

}
